<template>
    <div class="box-border py-4 flex flex-row justify-center items-center">
      <a-button type="primary" size="small" :loading="loading" v-if="hasNext" @click="$emit('next')">
        {{ loading ? loadingText : nextText }}
      </a-button>
      <div class="text-sm text-third text-center" v-else>--{{noMoreText}}--</div>
    </div>
</template>
<script lang="ts" setup>
defineOptions({
  name: "GpLoadNext",
  inheritAttrs: true
})
const { noMoreText = "没有更多了", hasNext, loading, loadingText = "加载中...", nextText = '继续加载' } = defineProps<{
  hasNext: boolean
  noMoreText?: string
  loading: boolean
  loadingText?: string
  nextText?: string
}>()
defineEmits<{
  next: []
}>()
</script>